package com.kingmed.kmss.framework.feign.client.admin;


import com.kingmed.kmss.common.dto.admin.ums.AdminAuthDTO;
import com.kingmed.kmss.common.dto.admin.ums.AdminDTO;
import com.kingmed.kmss.common.dto.admin.ums.AdminLoginDTO;
import com.kingmed.kmss.common.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 需要跟CommonAdminFeignService合并，不要搞两个
 */
@FeignClient(value = "kmss-admin", url = "${internalService.adminService.url}", contextId = "auth-admin-interface", fallback = RemoteAdminFallbackService.class)
public interface RemoteAdminService {

    /**
     * 必须加上范型<AdminAuthDto>
     */
    @PostMapping(value = "/admin/ext/ums/loginCheck")
    CommonResponse<AdminAuthDTO> loginCheck(@RequestBody AdminLoginDTO adminLoginDto);

    /**
     * OA登录获取登录用户信息
     */
    @GetMapping(value = "/admin/ext/ums/oaLoginQuery")
    CommonResponse<AdminAuthDTO> oaLoginQuery(@RequestParam String loginId);

    @GetMapping(value = "/admin/ext/ums/queryAdminByOAID")
    CommonResponse<AdminAuthDTO> queryAdminByOAID(@RequestParam String oaLoginId);

    @GetMapping(value = "/admin/ext/ums/getUserById")
    CommonResponse<AdminDTO> getUserById(@RequestParam String id);

    /**
     * 外部调用-根据员工号获取相关的信息（角色权限），用于对外接口的数据权限控制
     *
     * @param adminLoginDto
     * @return
     */
    @PostMapping(value = "/admin/ext/ums/loadAdminAuthDtoByUsernameNew")
    CommonResponse<AdminAuthDTO> loadAdminAuthDtoByUsernameNew(@RequestBody AdminLoginDTO adminLoginDto);

}
